package com.example.waterorder.tools;

import sun.misc.BASE64Decoder;

import java.io.*;

public class ImageUtil {
    /**
     * base64 转 input流
     * @param baseStr
     * @return 输入流
     */
    public static InputStream base2InputStream(String baseStr) {
        ByteArrayInputStream stream = null;
        try {
            BASE64Decoder decoder = new BASE64Decoder();
            byte[] bytes1 = decoder.decodeBuffer(baseStr);
            stream = new ByteArrayInputStream(bytes1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return stream;
    }



}
